package com.ysd.crm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ysd.crm.entity.Users;
import com.ysd.crm.service.LoginService;
import com.ysd.crm.utils.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RequestMapping("/login")
@Api
@RestController
public class LoginController {
	@Autowired
	private LoginService ls;
	
	/** 账号密码登录
	 * @param u
	 * @return
	 */
	@ApiOperation("账号密码登录-txh")
	@RequestMapping("userLogin")
	public String login(Users u) {
		Result result = ls.login(u);
		return Result.toJson(result);
	}
}
